<?php
use yii\helpers\Url;
use yii\web\View;
use app\assets\ProfitSettingAsset;
ProfitSettingAsset::register($this);
$this->title = $this->context->pageTitle.Yii::$app->params['titleSuffix'];
$this->params['breadcrumbs'] = [
  \Yii::t('profit', 'Profit Ratio Management'),
  \Yii::t('common', 'Data')
];
$jsMsgs = $this->context->loadJsMsgs([
  'table',
  'profitSetting'
]);
$this->registerJs("VAM.setVar('LANGUAGE_JS', '".$jsMsgs."');", View::POS_HEAD);
?>
<div class="page-header">
  <h1>
    <?=\Yii::t('profit', 'Profit Ratio Settings')?>
    <small><?=\Yii::t('profit', 'Profit Ratio List')?></small>
  </h1>
</div>
<div class="panel panel-default">
  <div class="panel-heading"> 
    <i class="fa fa-table"></i>
    <?=\Yii::t('profit', 'Profit Ratio Settings')?>
    <ul class="list-inline list-unstyled pull-right">
      <li>
        <a class="data-table-refresh" href="#" title="<?=\Yii::t('common', 'Click to refresh data')?>">
          <i class="fa fa-refresh"></i>
        </a>
      </li>
      <li>
        <a href="#">
          <i class="fa fa-chevron-up"></i>
        </a>
      </li>
    </ul>
  </div>
  <div class="panel-body">
    <div id="list-loading-wrap" class="local-loading-wrap"></div>
    <div class="table-responsive">
      <table class="table table-hover table-striped table-bordered table-condensed" id="data-table" data-tag="vm-adserver.profit-setting-list">
        <thead class="heading">
          <tr>
            <th data-search="on"><?=\Yii::t('profit', 'Solution ID')?></th>
            <th data-search="on"><?=\Yii::t('profit', 'Name')?></th>
            <th data-search="on"><?=\Yii::t('profit', 'Status')?></th>
            <th data-search="on"><?=\Yii::t('profit', 'Brand')?></th>
            <th data-search="on"><?=\Yii::t('profit', 'Start Time' )?></th>
            <th data-search="on"><?=\Yii::t('profit', 'End Time')?></th>
            <th data-search="on"><?=\Yii::t('profit', 'Budget')?></th>
            <th data-search="on"><?=\Yii::t('profit', 'Update Time')?></th>
            <th class="tab-lg" data-search="on"><?=\Yii::t('profit', 'Profit')?></th>
          </tr>
        </thead>
        <tbody>
          <tr role="row">
            <td class="text-center dataTables_empty" colspan="9"><?=\Yii::t('site', 'No Records')?></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
<?php
  $dataUrl = Url::to(['get-solution-list']);
  $dataHandleUrl = Url::to(['new-profit-setting-handle']);
  $this->registerJs("VAM.setVar('PROFIT_SETTING_DATA_LIST','$dataUrl');", View::POS_HEAD);
  $this->registerJs("VAM.setVar('PROFIT_SETTING_URL','$dataHandleUrl');", View::POS_HEAD);
?>
<script type="text/javascript" >
  requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/site.js"], function(common) {
    requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/profitSetting/profitList.js"]);
  });
</script>